import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class TestHw1 {
     public static void main(String[] args){

         Scanner in = new Scanner(System.in);
         while(in.hasNext()){
             String input = in.nextLine();
             int theMaxLengthOfInput = getMaxLength(input);
             System.out.println(theMaxLengthOfInput);
         }
     }


    /**
     *获取最长的单词的长度
     */
    public static int getMaxLength(String input){
        int maxLength = 0;
        String[] arrays = input.split("\\s+");
        List<String> list = new ArrayList<>();

        for(String arrayIndex: arrays){
            int length = arrayIndex.length();
            if(maxLength<length){
                maxLength = length;
            }
        }
        return maxLength;
    }
}
